Rails.application.routes.draw do

  namespace :api do
    resources :categories, only: [:index]
    resources :second_categories, only: [:index]
    resources :products, only: [:index, :show]
  end

  namespace :admin do
    namespace :api do
      resources :categories, only: [:index, :create, :update]
      resources :second_categories, only: [:index, :create, :update]
      resources :products, only: [:index, :create, :update]
    end
  end
end
